<script>
    export default{
        mounted() {
            this.forbidZoom();
            this.forbidZoomClick();
            this.$cancelIpadCursor();
            this.forbidZoomDoubleClick();
        },
        
        methods: {
            /** 禁止缩放(浏览器中) */
            forbidZoom() {
                document.addEventListener(
                    'keydown',
                    function (event) {
                        if ((event.ctrlKey || event.metaKey) && [61, 107, 173, 109, 187, 189].includes(event.keyCode)) {
                            event.preventDefault();
                        };
                    },
                    false
                );

                document.addEventListener(
                    'mousewheel',
                    function (e) {
                        e = e || window.event;
                        if ((e.wheelDelta && event.ctrlKey) || e.detail) {
                            event.preventDefault();
                        };
                    },
                    {
                        capture: false,
                        passive: false
                    }
                );
            },

            // 禁止双指放大（手机端）
            forbidZoomClick() {
                document.documentElement.addEventListener('touchstart', function (event) {
                    if (event.touches.length > 1) {
                        event.preventDefault();
                    };
                }, false);
            },

            // 禁止双击屏幕放大（手机端）
            forbidZoomDoubleClick() {
                let lastTouchEnd = 0;
                document.documentElement.addEventListener('touchend', function (event) {
                    var now = Date.now();
                    if (now - lastTouchEnd <= 300) {
                        event.preventDefault();
                    };
                    lastTouchEnd = now;
                }, false);
            }
        }
    }
</script>

<template>
    <div id="app">
        <router-view></router-view>
      <audio id="reverse-audio"></audio>
    </div>
</template>


<style lang="scss">
* { 
    -webkit-touch-callout:none; /*系统默认菜单被禁用*/
    -webkit-user-select:none; /*webkit浏览器*/
    -khtml-user-select:none; /*早期浏览器*/
    -moz-user-select:none;/*火狐*/
    -ms-user-select:none; /*IE10*/
    user-select:none; 
} 

.tagword {
    color: #fff;
    background:#019E69;
    background-color: #019E69;
}
</style>
